<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Messagebar Vue Component | Framework7 Vue Documentation</title>
    <meta property="og:image" content="http://framework7.io/i/f7-banner.jpg">
    <meta name="viewport" content="width=device-width, viewport-fit=cover">
    <meta name="twitter:card" content="summary">
    <meta name="twitter:site" content="@framework7io">
    <meta name="twitter:creator" content="@framework7io">
    <meta name="twitter:title" content="Messagebar Vue Component | Framework7 Vue Documentation">
    <meta name="twitter:image" content="https://avatars0.githubusercontent.com/u/31954178?s=200&amp;v=4">
    <link rel="stylesheet" href="/framework7-v3/css/normalize.css">
    <link rel="stylesheet" href="/framework7-v3/css/main.css">
    <link rel="shortcut icon" href="/framework7-v3/i/favicon.png">
    <script src="/framework7-v3/js/modernizr-2.7.1.min.js"></script>
  </head>
  <body class="body-docs">
    <header class="internal-header">
      <div class="center">
        <div class="logo-holder"><a class="logo" href="/framework7-v3/"></a></div>
        <div class="header-content">
          <div class="title">Framework7
            <div class="version">v3.6.7</div>
          </div>
          <ul class="nav">
            <li><a href="/framework7-v3/docs/">Docs</a>
              <ul>
                <li><a href="/framework7-v3/docs/introduction.html">Getting Started</a></li>
                <li><a href="/framework7-v3/docs/">Framework7 Core / API</a></li>
                <li><a href="/framework7-v3/vue/">Framework7 Vue</a></li>
                <li><a href="/framework7-v3/react/">Framework7 React</a></li>
                <li><a href="https://framework7.io/icons/" target="_blank">Framework7 Icons</a></li>
                <li><a href="/framework7-v3/docs/dom7.html">Dom7</a></li>
                <li><a href="http://idangero.us/template7/" target="_blank">Template7</a></li>
              </ul>
            </li>
            <li><a href="#">Resources</a>
              <ul>
                <li><a href="http://forum.framework7.io" target="_blank">Community Forum</a></li>
                <li><a href="https://framework7.io/tutorials/" target="_blank">Tutorials</a></li>
                <li><a href="https://framework7.io/templates/" target="_blank">Templates</a></li>
                <li><a href="https://framework7.io/plugins/" target="_blank">Plugins</a></li>
                <li><a href="https://framework7.io/showcase/" target="_blank">Apps Showcase</a></li>
                <li><a href="https://jobs.framework7.io" target="_blank">Jobs & Developers</a></li>
              </ul>
            </li>
            <li><a href="http://blog.framework7.io" target="_blank">Blog</a></li>
            <li><a href="https://framework7.io/contribute/" target="_blank">Contribute</a></li>
          </ul>
          <div class="patreon-github"><a class="patreon-button" href="https://www.patreon.com/vladimirkharlampidi" target="_blank"><span class="patreon-logo"></span><span class="patreon-text">Support Framework7</span></a>
            <div class="github-buttons"><a href="https://github.com/framework7io/framework7/" target="_blank"><img src="/framework7-v3/i/gh-logo.png"></a><a class="gh-stars" href="https://github.com/framework7io/framework7/" target="_blank"><span></span> stars</a><a class="gh-forks" href="https://github.com/framework7io/framework7/" target="_blank"><span></span> forks</a></div>
          </div>
        </div>
      </div>
    </header>
    <div class="bsa-cpc"></div>
    <main>
      <div class="center">
        <div class="docs-demo-device docs-demo-device-ios">
          <div class="docs-demo-device-buttons"><a class="active" data-theme="ios">iOS</a><a data-theme="md">Android</a></div>
          <div class="docs-demo-device-iframe">
            <iframe width="320" height="548" frameborder="0" scrolling="on"></iframe>
            <div class="fade-overlay"></div>
          </div>
          <div class="docs-demo-device-android-buttons">
            <div class="triangle"></div>
            <div class="circle"></div>
            <div class="square"></div>
          </div>
        </div>
        <div class="docs-nav">
          <div class="docs-nav-toggle"><span></span><span></span><span></span></div>
          <ul>
            <li>
              <div class="title">Get Started</div>
              <ul>
                <li><a href="introduction.html">Introduction</a></li>
                <li><a href="kitchen-sink.html">Kitchen Sink</a></li>
                <li><a href="installation.html">Installation</a></li>
                <li><a href="app-layout.html">App Layout</a></li>
                <li><a href="init-app.html">Initialize App</a></li>
                <li><a href="vue-component-extensions.html">Vue Component Extensions</a></li>
                <li><a href="navigation-router.html">Navigation / Router</a></li>
                <li><a href="colors.html">Color Properties</a></li>
              </ul>
            </li>
            <li>
              <div class="title">Vue Components</div>
              <ul>
                <li><a href="app.html">App</a></li>
                <li><a href="accordion.html">Accordion</a></li>
                <li><a href="action-sheet.html">Action Sheet / Actions</a></li>
                <li><a href="badge.html">Badge</a></li>
                <li><a href="block.html">Block / Content Block</a></li>
                <li><a href="button.html">Button</a></li>
                <li><a href="cards.html">Cards</a></li>
                <li><a href="checkbox.html">Checkbox</a></li>
                <li><a href="chips.html">Chips / Tags</a></li>
                <li><a href="contacts-list.html">Contacts List</a></li>
                <li><a href="floating-action-button.html">Floating Action Button / FAB</a></li>
                <li><a href="gauge.html">Gauge</a></li>
                <li><a href="grid.html">Grid / Layout Grid</a></li>
                <li><a href="icon.html">Icon</a></li>
                <li><a href="inputs.html">Inputs / Form Inputs</a></li>
                <li><a href="link.html">Link</a></li>
                <li><a href="list-view.html">List View</a></li>
                <li><a href="list-item.html">List Item</a></li>
                <li><a href="list-button.html">List Button</a></li>
                <li><a href="list-index.html">List Index</a></li>
                <li><a href="login-screen.html">Login Screen</a></li>
                <li><a href="messagebar.html">Messagebar</a></li>
                <li><a href="messages.html">Messages</a></li>
                <li><a href="navbar.html">Navbar</a></li>
                <li><a href="page.html">Page</a></li>
                <li><a href="panel.html">Panel / Side Panels</a></li>
                <li><a href="photo-browser.html">Photo Browser</a></li>
                <li><a href="popover.html">Popover</a></li>
                <li><a href="popup.html">Popup</a></li>
                <li><a href="preloader.html">Preloader</a></li>
                <li><a href="progressbar.html">Progressbar</a></li>
                <li><a href="radio.html">Radio</a></li>
                <li><a href="range-slider.html">Range Slider</a></li>
                <li><a href="searchbar.html">Searchbar</a></li>
                <li><a href="sheet-modal.html">Sheet Modal</a></li>
                <li><a href="smart-select.html">Smart Select</a></li>
                <li><a href="sortable.html">Sortable</a></li>
                <li><a href="statusbar.html">Statusbar</a></li>
                <li><a href="stepper.html">Stepper</a></li>
                <li><a href="subnavbar.html">Subnavbar</a></li>
                <li><a href="swiper.html">Swiper</a></li>
                <li><a href="swipeout.html">Swipeout</a></li>
                <li><a href="tabs.html">Tabs</a></li>
                <li><a href="toggle.html">Toggle</a></li>
                <li><a href="toolbar-tabbar.html">Toolbar / Tabbar</a></li>
                <li><a href="view.html">View</a></li>
                <li><a href="virtual-list.html">Virtual List</a></li>
              </ul>
            </li>
          </ul>
        </div>
        <div class="docs-content">
          <div class="improve-docs-link"><a href="https://github.com/gzxishan/framework7-websitev3/edit/master/src/pug/undefined" target="_blank">Improve this Doc</a></div>
          <h1>Messagebar Vue Component</h1>
          <ul class="docs-index"></ul>
          <p>Messagebar Vue component represents Framework7's <a href="../docs/messagebar.html">Messagebar</a> component.</p>
          <h2>Messagebar Components</h2>
          <p>There are following components included:</p>
          <ul>
            <li><code><b>f7-messagebar</b></code> - main messagebar element</li>
            <li><code><b>f7-messagebar-sheet</b></code> - messagebar sheet element</li>
            <li><code><b>f7-messagebar-sheet-image</b></code> - messagebar sheet image item</li>
            <li><code><b>f7-messagebar-sheet-item</b></code> - messagebar sheet item</li>
            <li><code><b>f7-messagebar-attachments</b></code> - messagebar attachments element</li>
            <li><code><b>f7-messagebar-attachment</b></code> - single messagebar attachment element</li>
          </ul>
          <p><img src="/framework7-v3/i/docs/messagebar-vue.jpg" style="max-width: 950px; width: 100%"></p>
          <h2>Messagebar Properties</h2>
          <table class="params-table">
            <thead>
              <tr>
                <th>Prop</th>
                <th>Type</th>
                <th>Default</th>
                <th>Description</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <th colspan="4">&lt;f7-messagebar&gt; properties</th>
              </tr>
              <tr>
                <td>init</td>
                <td>boolean</td>
                <td>true</td>
                <td>Initializes Messagebar</td>
              </tr>
              <tr>
                <td>name</td>
                <td>string</td>
                <td></td>
                <td>Textarea "name" attribute</td>
              </tr>
              <tr>
                <td>textarea-id</td>
                <td>string<br>number</td>
                <td></td>
                <td>Textarea "id" attribute</td>
              </tr>
              <tr>
                <td>placeholder</td>
                <td>string</td>
                <td>Message</td>
                <td>Textarea placeholder text</td>
              </tr>
              <tr>
                <td>value</td>
                <td>string<br>number</td>
                <td></td>
                <td>Textarea value</td>
              </tr>
              <tr>
                <td>readonly</td>
                <td>boolean</td>
                <td>false</td>
                <td>Sets "readonly" textarea attribute</td>
              </tr>
              <tr>
                <td>disabled</td>
                <td>boolean</td>
                <td>false</td>
                <td>Sets "disbled" textarea attribute</td>
              </tr>
              <tr>
                <td>send-link</td>
                <td>string</td>
                <td></td>
                <td>Enables Send link and specifies its text. This property will be ignored in case you use <code>send-link</code> slot</td>
              </tr>
              <tr>
                <td>max-height</td>
                <td>number</td>
                <td></td>
                <td>Defines resizeable textarea max height</td>
              </tr>
              <tr>
                <td>resizable</td>
                <td>bolean</td>
                <td>true</td>
                <td>Enables resizeable textarea</td>
              </tr>
              <tr>
                <td>sheet-visible</td>
                <td>boolean</td>
                <td>false</td>
                <td>Makes messagebar sheet visible/active</td>
              </tr>
              <tr>
                <td>attachments-visible</td>
                <td>boolean</td>
                <td>false</td>
                <td>Makes messagebar attachments visible/active</td>
              </tr>
              <tr>
                <td>resize-page</td>
                <td>boolean</td>
                <td>true</td>
                <td>When enabled, it will resize messages page when messagebar textarea size changed</td>
              </tr>
              <tr>
                <th colspan="4">&lt;f7-messagebar-sheet-image&gt; properties</th>
              </tr>
              <tr>
                <td>image</td>
                <td>string</td>
                <td></td>
                <td>Sheet image URL</td>
              </tr>
              <tr>
                <td>checked</td>
                <td>boolean</td>
                <td>false</td>
                <td>Indicates whether this sheet image-item is checked or not</td>
              </tr>
              <tr>
                <th colspan="4">&lt;f7-messagebar-attachment&gt; properties</th>
              </tr>
              <tr>
                <td>image</td>
                <td>string</td>
                <td></td>
                <td>Attachment image URL</td>
              </tr>
              <tr>
                <td>deletable</td>
                <td>boolean</td>
                <td>true</td>
                <td>Defines whether the attachment is deletable or not. In case of deletable the additional delete button will be rendered</td>
              </tr>
            </tbody>
          </table>
          <h2>Messagebar Methods</h2>
          <table class="methods-table">
            <tr>
              <th colspan="2">&lt;f7-messagebar&gt; methods</th>
            </tr>
            <tr>
              <td>.clear()</td>
              <td>Clear textarea and update/reset its size</td>
            </tr>
            <tr>
              <td>.setValue(<span>newValue</span>)</td>
              <td>Set messagebar textarea value/text</td>
            </tr>
            <tr>
              <td>.getValue()</td>
              <td>Return messagebar textarea value</td>
            </tr>
            <tr>
              <td>.resize()</td>
              <td>Force Messagebar to resize messages page depending on messagebar height/size</td>
            </tr>
            <tr>
              <td>.focus()</td>
              <td>Focus messagebar textarea</td>
            </tr>
            <tr>
              <td>.blur()</td>
              <td>Remove focus from messagebar textarea</td>
            </tr>
          </table>
          <h2>Messagebar Events</h2>
          <table class="events-table">
            <thead>
              <tr>
                <th>Event</th>
                <th>Arguments</th>
                <th>Description</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <th colspan="3">&lt;f7-messagebar&gt; events</th>
              </tr>
              <tr>
                <td>change</td>
                <td><span>(event)</span></td>
                <td>Event will be triggered when "change" event occurs on messagebar textarea element</td>
              </tr>
              <tr>
                <td>input</td>
                <td><span>(event)</span></td>
                <td>Event will be triggered when "input" event occurs on messagebar textarea element</td>
              </tr>
              <tr>
                <td>focus</td>
                <td><span>(event)</span></td>
                <td>Event will be triggered when "focus" event occurs on messagebar textarea element</td>
              </tr>
              <tr>
                <td>blur</td>
                <td><span>(event)</span></td>
                <td>Event will be triggered when "blur" event occurs on messagebar textarea element</td>
              </tr>
              <tr>
                <td>submit<br>send</td>
                <td><span>(value, clear)</span></td>
                <td>Event will be triggered when user clicks on messagebar "send link"</td>
              </tr>
              <tr>
                <th colspan="3">&lt;f7-messagebar-sheet-image&gt; events</th>
              </tr>
              <tr>
                <td>change</td>
                <td><span>(event)</span></td>
                <td>Event will be triggered on sheet item checkbox change</td>
              </tr>
              <tr>
                <th colspan="3">&lt;f7-messagebar-attachment&gt; events</th>
              </tr>
              <tr>
                <td>attachment:click</td>
                <td><span>(event)</span></td>
                <td>Event will be triggered on attachment click</td>
              </tr>
              <tr>
                <td>attachment:delete</td>
                <td><span>(event)</span></td>
                <td>Event will be triggered on attachment delete button click</td>
              </tr>
            </tbody>
          </table>
          <h2>Messagebar Slots</h2>
          <p>Messagebar Vue component has additional slots for custom elements:</p>
          <ul>
            <li><code><b>default</b></code> - element will be inserted in the end of <code>&lt;div class="toolbar-inner"&gt;</code>. element</li>
            <li><code><b>before-area</b></code> - element will be inserted right before textarea. Messagebar attachments go here</li>
            <li><code><b>after-area</b></code> - element will be inserted right after textarea</li>
            <li><code><b>send-link</b></code> - element will be inserted inside of send link</li>
            <li><code><b>before-inner</b></code> - element will be inserted right before <code>&lt;div class="toolbar-inner"&gt;</code>. element</li>
            <li><code><b>after-inner</b></code> - element will be inserted right after <code>&lt;div class="toolbar-inner"&gt;</code>. element. Messagebar sheet goes here</li>
            <li><code><b>inner-start</b></code> - element will be inserted in the beginning of <code>&lt;div class="toolbar-inner"&gt;</code>. element</li>
            <li><code><b>inner-end</b></code> - element will be inserted in the end of <code>&lt;div class="toolbar-inner"&gt;</code>. element. Same as <code>default</code> slot</li>
          </ul><pre><code class=""><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>f7-messagebar</span> <span class="token attr-name">placeholder</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>Message<span class="token punctuation">"</span></span> <span class="token attr-name">@submit</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>onSubmit<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">slot</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>before-inner<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Before inner<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">slot</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>after-inner<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>After inner<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">slot</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>before-area<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>Before textarea<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">slot</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>after-area<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>After textarea<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>f7-icon</span> <span class="token attr-name">ios</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>f7:arrow_up_fill<span class="token punctuation">"</span></span> <span class="token attr-name">md</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>material:send<span class="token punctuation">"</span></span> <span class="token attr-name">slot</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>send-link<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>f7-icon</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">></span></span>Default slot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>f7-messagebar</span><span class="token punctuation">></span></span></pre></code>
          <p>Renders to:</p><pre><code class=""><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>toolbar messagebar<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">></span></span>Before inner<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>toolbar-inner<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>messagebar-area<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">></span></span>Before textarea<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>textarea</span> <span class="token attr-name">placeholder</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>Message<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>textarea</span><span class="token punctuation">></span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">></span></span>After textarea<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>#<span class="token punctuation">"</span></span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>link<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>i</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>icon f7-icons<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>arrow_up_fill<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>i</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>a</span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">></span></span>Default slot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">></span></span>After inner<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span>
</pre></code>
          <h2>Access To Messagebar Instance</h2>
          <p>If you use automatic initalization to init Messagebar (with <code>init:true</code> prop) and need to use its <a href="../docs/messagebar.html#messagebar-methods-properties">Methods and Properties</a> you can access its initialized instance by accessing <code><b>.f7Messagebar</b></code> component's property.</p>
          <div class="with-device">
            <h2 data-device-preview="../docs-demos/vue/messages.html">Examples</h2>
            <p>Here is how the full example of Messages page where it can be used together with <a href="messages.html">Messages</a>:</p><pre><code class="html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>template</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>f7-page</span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>f7-navbar</span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>Messsages<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>f7-navbar</span><span class="token punctuation">></span></span>

    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>f7-messagebar</span>
      <span class="token attr-name">:placeholder</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>placeholder<span class="token punctuation">"</span></span>
      <span class="token attr-name">ref</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>messagebar<span class="token punctuation">"</span></span>
      <span class="token attr-name">:attachments-visible</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>attachmentsVisible<span class="token punctuation">"</span></span>
      <span class="token attr-name">:sheet-visible</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>sheetVisible<span class="token punctuation">"</span></span>
    <span class="token punctuation">></span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>f7-link</span>
        <span class="token attr-name">icon-ios</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>f7:camera_fill<span class="token punctuation">"</span></span>
        <span class="token attr-name">icon-md</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>material:camera_alt<span class="token punctuation">"</span></span>
        <span class="token attr-name">slot</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>inner-start<span class="token punctuation">"</span></span>
        <span class="token attr-name">@click</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>sheetVisible = !sheetVisible<span class="token punctuation">"</span></span>
      <span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>f7-link</span><span class="token punctuation">></span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>f7-link</span>
        <span class="token attr-name">icon-ios</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>f7:arrow_up_fill<span class="token punctuation">"</span></span>
        <span class="token attr-name">icon-md</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>material:send<span class="token punctuation">"</span></span>
        <span class="token attr-name">slot</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>inner-end<span class="token punctuation">"</span></span>
        <span class="token attr-name">@click</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>sendMessage<span class="token punctuation">"</span></span>
      <span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>f7-link</span><span class="token punctuation">></span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>f7-messagebar-attachments</span><span class="token punctuation">></span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>f7-messagebar-attachment</span>
          <span class="token attr-name">v-for</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>(image, index) in attachments<span class="token punctuation">"</span></span>
          <span class="token attr-name">:key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>index<span class="token punctuation">"</span></span>
          <span class="token attr-name">:image</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>image<span class="token punctuation">"</span></span>
          <span class="token attr-name"><span class="token namespace">@attachment:</span>delete</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>deleteAttachment(image)<span class="token punctuation">"</span></span>
        <span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>f7-messagebar-attachment</span><span class="token punctuation">></span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>f7-messagebar-attachments</span><span class="token punctuation">></span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>f7-messagebar-sheet</span><span class="token punctuation">></span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>f7-messagebar-sheet-image</span>
          <span class="token attr-name">v-for</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>(image, index) in images<span class="token punctuation">"</span></span>
          <span class="token attr-name">:key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>index<span class="token punctuation">"</span></span>
          <span class="token attr-name">:image</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>image<span class="token punctuation">"</span></span>
          <span class="token attr-name">:checked</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>attachments.indexOf(image) >= 0<span class="token punctuation">"</span></span>
          <span class="token attr-name">@change</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>handleAttachment<span class="token punctuation">"</span></span>
        <span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>f7-messagebar-sheet-image</span><span class="token punctuation">></span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>f7-messagebar-sheet</span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>f7-messagebar</span><span class="token punctuation">></span></span>

    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>f7-messages</span> <span class="token attr-name">ref</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>messages<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>f7-messages-title</span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>b</span><span class="token punctuation">></span></span>Sunday, Feb 9,<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>b</span><span class="token punctuation">></span></span> 12:58<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>f7-messages-title</span><span class="token punctuation">></span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>f7-message</span>
        <span class="token attr-name">v-for</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>(message, index) in messagesData<span class="token punctuation">"</span></span>
        <span class="token attr-name">:key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>index<span class="token punctuation">"</span></span>
        <span class="token attr-name">:type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>message.type<span class="token punctuation">"</span></span>
        <span class="token attr-name">:image</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>message.image<span class="token punctuation">"</span></span>
        <span class="token attr-name">:name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>message.name<span class="token punctuation">"</span></span>
        <span class="token attr-name">:avatar</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>message.avatar<span class="token punctuation">"</span></span>
        <span class="token attr-name">:first</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>isFirstMessage(message, index)<span class="token punctuation">"</span></span>
        <span class="token attr-name">:last</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>isLastMessage(message, index)<span class="token punctuation">"</span></span>
        <span class="token attr-name">:tail</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>isTailMessage(message, index)<span class="token punctuation">"</span></span>
      <span class="token punctuation">></span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>span</span> <span class="token attr-name">slot</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>text<span class="token punctuation">"</span></span> <span class="token attr-name">v-if</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>message.text<span class="token punctuation">"</span></span> <span class="token attr-name">v-html</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>message.text<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>span</span><span class="token punctuation">></span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>f7-message</span><span class="token punctuation">></span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>f7-message</span> <span class="token attr-name">v-if</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>typingMessage<span class="token punctuation">"</span></span>
        <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>received<span class="token punctuation">"</span></span>
        <span class="token attr-name">:typing</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span>
        <span class="token attr-name">:first</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span>
        <span class="token attr-name">:last</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span>
        <span class="token attr-name">:tail</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span>
        <span class="token attr-name">:header</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>`${typingMessage.name} is typing`<span class="token punctuation">"</span></span>
        <span class="token attr-name">:avatar</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>typingMessage.avatar<span class="token punctuation">"</span></span>
      <span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>f7-message</span><span class="token punctuation">></span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>f7-messages</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>f7-page</span><span class="token punctuation">></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>template</span><span class="token punctuation">></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span><span class="token punctuation">></span></span><span class="token script"><span class="token language-javascript">
  <span class="token keyword-block">export</span> <span class="token keyword-block">default</span> <span class="token punctuation">{</span>
    <span class="token function">data</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword-block">return</span> <span class="token punctuation">{</span>
        attachments<span class="token punctuation">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
        sheetVisible<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
        typingMessage<span class="token punctuation">:</span> <span class="token literal">null</span><span class="token punctuation">,</span>
        messagesData<span class="token punctuation">:</span> <span class="token punctuation">[</span>
          <span class="token punctuation">{</span>
            type<span class="token punctuation">:</span> <span class="token string">'sent'</span><span class="token punctuation">,</span>
            text<span class="token punctuation">:</span> <span class="token string">'Hi, Kate'</span><span class="token punctuation">,</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token punctuation">{</span>
            type<span class="token punctuation">:</span> <span class="token string">'sent'</span><span class="token punctuation">,</span>
            text<span class="token punctuation">:</span> <span class="token string">'How are you?'</span><span class="token punctuation">,</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token punctuation">{</span>
            name<span class="token punctuation">:</span> <span class="token string">'Kate'</span><span class="token punctuation">,</span>
            type<span class="token punctuation">:</span> <span class="token string">'received'</span><span class="token punctuation">,</span>
            text<span class="token punctuation">:</span> <span class="token string">'Hi, I am good!'</span><span class="token punctuation">,</span>
            avatar<span class="token punctuation">:</span> <span class="token string">'http://lorempixel.com/100/100/people/9'</span><span class="token punctuation">,</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token punctuation">{</span>
            name<span class="token punctuation">:</span> <span class="token string">'Blue Ninja'</span><span class="token punctuation">,</span>
            type<span class="token punctuation">:</span> <span class="token string">'received'</span><span class="token punctuation">,</span>
            text<span class="token punctuation">:</span> <span class="token string">'Hi there, I am also fine, thanks! And how are you?'</span><span class="token punctuation">,</span>
            avatar<span class="token punctuation">:</span> <span class="token string">'http://lorempixel.com/100/100/people/7'</span><span class="token punctuation">,</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token punctuation">{</span>
            type<span class="token punctuation">:</span> <span class="token string">'sent'</span><span class="token punctuation">,</span>
            text<span class="token punctuation">:</span> <span class="token string">'Hey, Blue Ninja! Glad to see you ;)'</span><span class="token punctuation">,</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token punctuation">{</span>
            type<span class="token punctuation">:</span> <span class="token string">'sent'</span><span class="token punctuation">,</span>
            text<span class="token punctuation">:</span> <span class="token string">'Hey, look, cutest kitten ever!'</span><span class="token punctuation">,</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token punctuation">{</span>
            type<span class="token punctuation">:</span> <span class="token string">'sent'</span><span class="token punctuation">,</span>
            image<span class="token punctuation">:</span> <span class="token string">'http://lorempixel.com/200/260/cats/4/'</span><span class="token punctuation">,</span>

          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token punctuation">{</span>
            name<span class="token punctuation">:</span> <span class="token string">'Kate'</span><span class="token punctuation">,</span>
            type<span class="token punctuation">:</span> <span class="token string">'received'</span><span class="token punctuation">,</span>
            text<span class="token punctuation">:</span> <span class="token string">'Nice!'</span><span class="token punctuation">,</span>
            avatar<span class="token punctuation">:</span> <span class="token string">'http://lorempixel.com/100/100/people/9'</span><span class="token punctuation">,</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token punctuation">{</span>
            name<span class="token punctuation">:</span> <span class="token string">'Kate'</span><span class="token punctuation">,</span>
            type<span class="token punctuation">:</span> <span class="token string">'received'</span><span class="token punctuation">,</span>
            text<span class="token punctuation">:</span> <span class="token string">'Like it very much!'</span><span class="token punctuation">,</span>
            avatar<span class="token punctuation">:</span> <span class="token string">'http://lorempixel.com/100/100/people/9'</span><span class="token punctuation">,</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token punctuation">{</span>
            name<span class="token punctuation">:</span> <span class="token string">'Blue Ninja'</span><span class="token punctuation">,</span>
            type<span class="token punctuation">:</span> <span class="token string">'received'</span><span class="token punctuation">,</span>
            text<span class="token punctuation">:</span> <span class="token string">'Awesome!'</span><span class="token punctuation">,</span>
            avatar<span class="token punctuation">:</span> <span class="token string">'http://lorempixel.com/100/100/people/7'</span><span class="token punctuation">,</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token punctuation">]</span><span class="token punctuation">,</span>
        images<span class="token punctuation">:</span> <span class="token punctuation">[</span>
          <span class="token string">'http://lorempixel.com/300/300/cats/1/'</span><span class="token punctuation">,</span>
          <span class="token string">'http://lorempixel.com/200/300/cats/2/'</span><span class="token punctuation">,</span>
          <span class="token string">'http://lorempixel.com/400/300/cats/3/'</span><span class="token punctuation">,</span>
          <span class="token string">'http://lorempixel.com/300/150/cats/4/'</span><span class="token punctuation">,</span>
          <span class="token string">'http://lorempixel.com/150/300/cats/5/'</span><span class="token punctuation">,</span>
          <span class="token string">'http://lorempixel.com/300/300/cats/6/'</span><span class="token punctuation">,</span>
          <span class="token string">'http://lorempixel.com/300/300/cats/7/'</span><span class="token punctuation">,</span>
          <span class="token string">'http://lorempixel.com/200/300/cats/8/'</span><span class="token punctuation">,</span>
          <span class="token string">'http://lorempixel.com/400/300/cats/9/'</span><span class="token punctuation">,</span>
          <span class="token string">'http://lorempixel.com/300/150/cats/10/'</span><span class="token punctuation">,</span>
        <span class="token punctuation">]</span><span class="token punctuation">,</span>
        people<span class="token punctuation">:</span> <span class="token punctuation">[</span>
          <span class="token punctuation">{</span>
            name<span class="token punctuation">:</span> <span class="token string">'Kate Johnson'</span><span class="token punctuation">,</span>
            avatar<span class="token punctuation">:</span> <span class="token string">'http://lorempixel.com/100/100/people/9'</span><span class="token punctuation">,</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
          <span class="token punctuation">{</span>
            name<span class="token punctuation">:</span> <span class="token string">'Blue Ninja'</span><span class="token punctuation">,</span>
            avatar<span class="token punctuation">:</span> <span class="token string">'http://lorempixel.com/100/100/people/7'</span><span class="token punctuation">,</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token punctuation">]</span><span class="token punctuation">,</span>
        answers<span class="token punctuation">:</span> <span class="token punctuation">[</span>
          <span class="token string">'Yes!'</span><span class="token punctuation">,</span>
          <span class="token string">'No'</span><span class="token punctuation">,</span>
          <span class="token string">'Hm...'</span><span class="token punctuation">,</span>
          <span class="token string">'I am not sure'</span><span class="token punctuation">,</span>
          <span class="token string">'And what about you?'</span><span class="token punctuation">,</span>
          <span class="token string">'May be ;)'</span><span class="token punctuation">,</span>
          <span class="token string">'Lorem ipsum dolor sit amet, consectetur'</span><span class="token punctuation">,</span>
          <span class="token string">'What?'</span><span class="token punctuation">,</span>
          <span class="token string">'Are you sure?'</span><span class="token punctuation">,</span>
          <span class="token string">'Of course'</span><span class="token punctuation">,</span>
          <span class="token string">'Need to think about it'</span><span class="token punctuation">,</span>
          <span class="token string">'Amazing!!!'</span><span class="token punctuation">,</span>
        <span class="token punctuation">]</span><span class="token punctuation">,</span>
        responseInProgress<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
      <span class="token punctuation">}</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    computed<span class="token punctuation">:</span> <span class="token punctuation">{</span>
      <span class="token function">attachmentsVisible</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">const</span> <span class="token context">self</span> <span class="token operator">=</span> <span class="token context">this</span><span class="token punctuation">;</span>
        <span class="token keyword-block">return</span> <span class="token context">self</span><span class="token punctuation">.</span>attachments<span class="token punctuation">.</span>length <span class="token operator">></span> <span class="token number">0</span><span class="token punctuation">;</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token function">placeholder</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">const</span> <span class="token context">self</span> <span class="token operator">=</span> <span class="token context">this</span><span class="token punctuation">;</span>
        <span class="token keyword-block">return</span> <span class="token context">self</span><span class="token punctuation">.</span>attachments<span class="token punctuation">.</span>length <span class="token operator">></span> <span class="token number">0</span> <span class="token operator">?</span> <span class="token string">'Add comment or Send'</span> <span class="token punctuation">:</span> <span class="token string">'Message'</span><span class="token punctuation">;</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token function">mounted</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
      <span class="token keyword">const</span> <span class="token context">self</span> <span class="token operator">=</span> <span class="token context">this</span><span class="token punctuation">;</span>
      <span class="token context">self</span><span class="token punctuation">.</span><span class="token function">$f7ready</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span>
        <span class="token context">self</span><span class="token punctuation">.</span>messagebar <span class="token operator">=</span> <span class="token context">self</span><span class="token punctuation">.</span>$refs<span class="token punctuation">.</span>messagebar<span class="token punctuation">.</span>f7Messagebar<span class="token punctuation">;</span>
        <span class="token context">self</span><span class="token punctuation">.</span>messages <span class="token operator">=</span> <span class="token context">self</span><span class="token punctuation">.</span>$refs<span class="token punctuation">.</span>messages<span class="token punctuation">.</span>f7Messages<span class="token punctuation">;</span>
      <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
    methods<span class="token punctuation">:</span> <span class="token punctuation">{</span>
      <span class="token function">isFirstMessage</span><span class="token punctuation">(</span><span class="token parameter">message<span class="token punctuation">,</span> index</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">const</span> <span class="token context">self</span> <span class="token operator">=</span> <span class="token context">this</span><span class="token punctuation">;</span>
        <span class="token keyword">const</span> previousMessage <span class="token operator">=</span> <span class="token context">self</span><span class="token punctuation">.</span>messagesData<span class="token punctuation">[</span>index <span class="token operator">-</span> <span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
        <span class="token keyword-block">if</span> <span class="token punctuation">(</span>message<span class="token punctuation">.</span>isTitle<span class="token punctuation">)</span> <span class="token keyword-block">return</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
        <span class="token keyword-block">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>previousMessage <span class="token operator">||</span> previousMessage<span class="token punctuation">.</span>type <span class="token operator">!==</span> message<span class="token punctuation">.</span>type <span class="token operator">||</span> previousMessage<span class="token punctuation">.</span>name <span class="token operator">!==</span> message<span class="token punctuation">.</span>name<span class="token punctuation">)</span> <span class="token keyword-block">return</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
        <span class="token keyword-block">return</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token function">isLastMessage</span><span class="token punctuation">(</span><span class="token parameter">message<span class="token punctuation">,</span> index</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">const</span> <span class="token context">self</span> <span class="token operator">=</span> <span class="token context">this</span><span class="token punctuation">;</span>
        <span class="token keyword">const</span> nextMessage <span class="token operator">=</span> <span class="token context">self</span><span class="token punctuation">.</span>messagesData<span class="token punctuation">[</span>index <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
        <span class="token keyword-block">if</span> <span class="token punctuation">(</span>message<span class="token punctuation">.</span>isTitle<span class="token punctuation">)</span> <span class="token keyword-block">return</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
        <span class="token keyword-block">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>nextMessage <span class="token operator">||</span> nextMessage<span class="token punctuation">.</span>type <span class="token operator">!==</span> message<span class="token punctuation">.</span>type <span class="token operator">||</span> nextMessage<span class="token punctuation">.</span>name <span class="token operator">!==</span> message<span class="token punctuation">.</span>name<span class="token punctuation">)</span> <span class="token keyword-block">return</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
        <span class="token keyword-block">return</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token function">isTailMessage</span><span class="token punctuation">(</span><span class="token parameter">message<span class="token punctuation">,</span> index</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">const</span> <span class="token context">self</span> <span class="token operator">=</span> <span class="token context">this</span><span class="token punctuation">;</span>
        <span class="token keyword">const</span> nextMessage <span class="token operator">=</span> <span class="token context">self</span><span class="token punctuation">.</span>messagesData<span class="token punctuation">[</span>index <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
        <span class="token keyword-block">if</span> <span class="token punctuation">(</span>message<span class="token punctuation">.</span>isTitle<span class="token punctuation">)</span> <span class="token keyword-block">return</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
        <span class="token keyword-block">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>nextMessage <span class="token operator">||</span> nextMessage<span class="token punctuation">.</span>type <span class="token operator">!==</span> message<span class="token punctuation">.</span>type <span class="token operator">||</span> nextMessage<span class="token punctuation">.</span>name <span class="token operator">!==</span> message<span class="token punctuation">.</span>name<span class="token punctuation">)</span> <span class="token keyword-block">return</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
        <span class="token keyword-block">return</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token function">deleteAttachment</span><span class="token punctuation">(</span><span class="token parameter">image</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">const</span> <span class="token context">self</span> <span class="token operator">=</span> <span class="token context">this</span><span class="token punctuation">;</span>
        <span class="token keyword">const</span> index <span class="token operator">=</span> <span class="token context">self</span><span class="token punctuation">.</span>attachments<span class="token punctuation">.</span><span class="token function">indexOf</span><span class="token punctuation">(</span>image<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token context">self</span><span class="token punctuation">.</span>attachments<span class="token punctuation">.</span><span class="token function">splice</span><span class="token punctuation">(</span>index<span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token comment">// eslint-disable-line</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token function">handleAttachment</span><span class="token punctuation">(</span><span class="token parameter">e</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">const</span> <span class="token context">self</span> <span class="token operator">=</span> <span class="token context">this</span><span class="token punctuation">;</span>
        <span class="token keyword">const</span> index <span class="token operator">=</span> <span class="token context">self</span><span class="token punctuation">.</span><span class="token function">$$</span><span class="token punctuation">(</span>e<span class="token punctuation">.</span>target<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">parents</span><span class="token punctuation">(</span><span class="token string">'label.checkbox'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">index</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">const</span> image <span class="token operator">=</span> <span class="token context">self</span><span class="token punctuation">.</span>images<span class="token punctuation">[</span>index<span class="token punctuation">]</span><span class="token punctuation">;</span>
        <span class="token keyword-block">if</span> <span class="token punctuation">(</span>e<span class="token punctuation">.</span>target<span class="token punctuation">.</span>checked<span class="token punctuation">)</span> <span class="token punctuation">{</span>
          <span class="token comment">// Add to attachments</span>
          <span class="token context">self</span><span class="token punctuation">.</span>attachments<span class="token punctuation">.</span><span class="token function">unshift</span><span class="token punctuation">(</span>image<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span> <span class="token keyword-block">else</span> <span class="token punctuation">{</span>
          <span class="token comment">// Remove from attachments</span>
          <span class="token context">self</span><span class="token punctuation">.</span>attachments<span class="token punctuation">.</span><span class="token function">splice</span><span class="token punctuation">(</span><span class="token context">self</span><span class="token punctuation">.</span>attachments<span class="token punctuation">.</span><span class="token function">indexOf</span><span class="token punctuation">(</span>image<span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token function">sendMessage</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">const</span> <span class="token context">self</span> <span class="token operator">=</span> <span class="token context">this</span><span class="token punctuation">;</span>
        <span class="token keyword">const</span> text <span class="token operator">=</span> <span class="token context">self</span><span class="token punctuation">.</span>messagebar<span class="token punctuation">.</span><span class="token function">getValue</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">replace</span><span class="token punctuation">(</span><span class="token regex">/\n/g</span><span class="token punctuation">,</span> <span class="token string">'&lt;br>'</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">trim</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">const</span> messagesToSend <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
        <span class="token context">self</span><span class="token punctuation">.</span>attachments<span class="token punctuation">.</span><span class="token function">forEach</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">attachment</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span>
          messagesToSend<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
            image<span class="token punctuation">:</span> attachment<span class="token punctuation">,</span>
          <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword-block">if</span> <span class="token punctuation">(</span>text<span class="token punctuation">.</span><span class="token function">trim</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span>length<span class="token punctuation">)</span> <span class="token punctuation">{</span>
          messagesToSend<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
            text<span class="token punctuation">,</span>
          <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
        <span class="token keyword-block">if</span> <span class="token punctuation">(</span>messagesToSend<span class="token punctuation">.</span>length <span class="token operator">===</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
          <span class="token keyword-block">return</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>

        <span class="token comment">// Reset attachments</span>
        <span class="token context">self</span><span class="token punctuation">.</span>attachments <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
        <span class="token comment">// Hide sheet</span>
        <span class="token context">self</span><span class="token punctuation">.</span>sheetVisible <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
        <span class="token comment">// Clear area</span>
        <span class="token context">self</span><span class="token punctuation">.</span>messagebar<span class="token punctuation">.</span><span class="token function">clear</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token comment">// Focus area</span>
        <span class="token keyword-block">if</span> <span class="token punctuation">(</span>text<span class="token punctuation">.</span>length<span class="token punctuation">)</span> <span class="token context">self</span><span class="token punctuation">.</span>messagebar<span class="token punctuation">.</span><span class="token function">focus</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token comment">// Send message</span>
        <span class="token context">self</span><span class="token punctuation">.</span>messagesData<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span><span class="token operator">...</span>messagesToSend<span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token comment">// Mock response</span>
        <span class="token keyword-block">if</span> <span class="token punctuation">(</span><span class="token context">self</span><span class="token punctuation">.</span>responseInProgress<span class="token punctuation">)</span> <span class="token keyword-block">return</span><span class="token punctuation">;</span>
        <span class="token context">self</span><span class="token punctuation">.</span>responseInProgress <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
        <span class="token function">setTimeout</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span>
          <span class="token keyword">const</span> answer <span class="token operator">=</span> <span class="token context">self</span><span class="token punctuation">.</span>answers<span class="token punctuation">[</span><span class="token built-in">Math</span><span class="token punctuation">.</span><span class="token function">floor</span><span class="token punctuation">(</span><span class="token built-in">Math</span><span class="token punctuation">.</span><span class="token function">random</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">*</span> <span class="token context">self</span><span class="token punctuation">.</span>answers<span class="token punctuation">.</span>length<span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
          <span class="token keyword">const</span> person <span class="token operator">=</span> <span class="token context">self</span><span class="token punctuation">.</span>people<span class="token punctuation">[</span><span class="token built-in">Math</span><span class="token punctuation">.</span><span class="token function">floor</span><span class="token punctuation">(</span><span class="token built-in">Math</span><span class="token punctuation">.</span><span class="token function">random</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">*</span> <span class="token context">self</span><span class="token punctuation">.</span>people<span class="token punctuation">.</span>length<span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
          <span class="token context">self</span><span class="token punctuation">.</span>typingMessage <span class="token operator">=</span> <span class="token punctuation">{</span>
            name<span class="token punctuation">:</span> person<span class="token punctuation">.</span>name<span class="token punctuation">,</span>
            avatar<span class="token punctuation">:</span> person<span class="token punctuation">.</span>avatar<span class="token punctuation">,</span>
          <span class="token punctuation">}</span><span class="token punctuation">;</span>
          <span class="token function">setTimeout</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span>
            <span class="token context">self</span><span class="token punctuation">.</span>messagesData<span class="token punctuation">.</span><span class="token function">push</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
              text<span class="token punctuation">:</span> answer<span class="token punctuation">,</span>
              type<span class="token punctuation">:</span> <span class="token string">'received'</span><span class="token punctuation">,</span>
              name<span class="token punctuation">:</span> person<span class="token punctuation">.</span>name<span class="token punctuation">,</span>
              avatar<span class="token punctuation">:</span> person<span class="token punctuation">.</span>avatar<span class="token punctuation">,</span>
            <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token context">self</span><span class="token punctuation">.</span>typingMessage <span class="token operator">=</span> <span class="token literal">null</span><span class="token punctuation">;</span>
            <span class="token context">self</span><span class="token punctuation">.</span>responseInProgress <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token number">4000</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token number">1000</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token punctuation">}</span><span class="token punctuation">;</span>
</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">></span></span></pre></code>
          </div>
        </div>
      </div>
    </main>
    <script src="/framework7-v3/js/jquery-1.11.0.min.js"></script>
    <script src="/framework7-v3/js/main.js"></script>
  </body>
</html>